﻿@using SunTzu.Utility;
@model form_visitor
@{
    ViewBag.Title = "参会回执";
    Layout = "~/Views/Shared/_LayoutUserCenter.cshtml";
    List<int> scopes = new List<int>();
    if(!string.IsNullOrEmpty(Model.Scope))
    {
        scopes.AddRange(Model.Scope.Split(',').Select(c => c.ParseToInt()));
    }

    List<int> areas = new List<int>();
    if (!string.IsNullOrEmpty(Model.Area))
    {
        areas.AddRange(Model.Area.Split(',').Select(c => c.ParseToInt()));
    }
    List<int> purposeNeeds = new List<int>();
    if (!string.IsNullOrEmpty(Model.PurposeNeed))
    {
        purposeNeeds.AddRange(Model.PurposeNeed.Split(',').Select(c => c.ParseToInt()));
    }
    List<int> purposeOffers = new List<int>();
    if (!string.IsNullOrEmpty(Model.PurposeOffer))
    {
        purposeOffers.AddRange(Model.PurposeOffer.Split(',').Select(c => c.ParseToInt()));
    }
    List<int> services = new List<int>();
    if (!string.IsNullOrEmpty(Model.Service))
    {
        services.AddRange(Model.Service.Split(',').Select(c => c.ParseToInt()));
    }
    if(Model.Id == 0)
    {
        Model.IsReceiveEmail = true;
        Model.MainContacterGender = true;
        Model.ContacterGender = true;
    }
    bool isWaiting = Model.Id > 0 && Model.State == 0;
    bool isApproved = Model.State == 1;
}
<script src="/js/exhibitor.js"></script>
    <div class="registerForm registerFormInner">
    <form id="editForm" action="/Visitor/CreateVisitor?id=@Model.Id" method="post">
        <p class="registerFormTitle">参会回执</p>
        @if (isWaiting)
        {
        <p class="hCent redText">* 您的参会回执已经提交，正在等待审核。您可以继续修改以下内容</p>
        }
        else if (isApproved)
        {
        <p class="hCent redText">* 您的参会回执已经通过审核。</p>
        }
        <div class="registerFormSubTitle">公司信息</div>
        <ul>
            <li class="formProp"><span>*</span>公司名称：</li>
            <li class="formLongLine">
                <input type="text" class="inputLong required" name="Title" id="Title" value="@Model.Title" />
                <span targetId="Title" class="tipMsg">请输入公司名称</span>
            </li>
            <li class="clear"></li>
        </ul>
        <ul>
            <li class="formProp"><span>*</span>公司地址：</li>
            <li class="formLongLine">
                <input type="text" class="inputLong required" name="Address" id="Address" value="@Model.Address" />
                <span targetId="Address" class="tipMsg">请输入公司地址</span>
            </li>
            <li class="clear"></li>
        </ul>
        <ul>
            <li class="formProp">国家/地区：</li>
            <li class="formLongLine">
                <input type="text" class="inputLong" name="Region" id="Region" value="@Model.Region" />
            </li>
            <li class="clear"></li>
        </ul>
        <ul>
            <li class="formProp"><span>*</span>邮政编码：</li>
            <li class="formLongLine">
                <input type="text" class="inputLong required" name="PostCode" id="PostCode" value="@Model.PostCode" />
                <span targetId="PostCode" class="tipMsg">请输入邮政编码</span>
            </li>
            <li class="clear"></li>
        </ul>
        <ul>
            <li class="formProp"><span>*</span>电话：</li>
            <li class="formLongLine">
                <input type="text" class="inputLong required" name="Tel" id="Tel" value="@Model.Tel" />
                <span targetId="Tel" class="tipMsg">请输入电话</span>
            </li>
            <li class="clear"></li>
        </ul>
        <ul>
            <li class="formProp"><span>*</span>传真：</li>
            <li class="formLongLine">
                <input type="text" class="inputLong required" name="Fax" id="Fax" value="@Model.Fax" />
                <span targetId="Fax" class="tipMsg">请输入传真</span>
            </li>
            <li class="clear"></li>
        </ul>
        <ul>
            <li class="formProp">网址：</li>
            <li class="formLongLine">
                <input type="text" class="inputLong" name="Url" id="Url" value="@Model.Url" />
            </li>
            <li class="clear"></li>
        </ul>
        <ul>
            <li class="formProp">成立年份：</li>
            <li class="formLongLine">
                <input type="text" class="inputLong" name="Year" id="Year" value="@Model.Year" />
            </li>
            <li class="clear"></li>
        </ul>
        <ul>
            <li class="formProp">年营业额：</li>
            <li class="formLongLine">
                <input type="text" class="inputLong" name="Revenue" id="Revenue" value="@Model.Revenue" />
            </li>
            <li class="clear"></li>
        </ul>
        <ul>
            <li class="formProp"><span>*</span>主营项目：</li>
            <li class="formLongLine">
                <textarea name="MainBussiness" id="MainBussiness" class="required textareaLong" rows="6" cols="5">@Model.MainBussiness</textarea>
                <span targetId="MainBussiness" class="tipMsg">请输入主营项目</span>
            </li>
            <li class="clear"></li>
        </ul>

        <div class="registerFormSubTitle">参会人员信息</div>
        <ul>
            <li class="formProp"><span>*</span>姓名：</li>
            <li class="formLongLine">
                <input type="text" class="inputNormal required" name="MainContacter" id="MainContacter" value="@Model.MainContacter" />
                <input type="radio" value="True" name="MainContacterGender" @(Model.MainContacterGender ? "checked" : "") /> 先生
                <input type="radio" value="False" name="MainContacterGender" @(!Model.MainContacterGender ? "checked" : "") /> 女士
                <span targetId="MainContacter" class="tipMsg">请输入姓名</span>
            </li>
            <li class="clear"></li>
        </ul>
        <ul>
            <li class="formProp">职务：</li>
            <li class="formLongLine">
                <input type="text" class="inputLong" name="MainContacterTitle" id="MainContacterTitle" value="@Model.MainContacterTitle" />
            </li>
            <li class="clear"></li>
        </ul>
        <ul>
            <li class="formProp"><span>*</span>移动电话：</li>
            <li class="formLongLine">
                <input type="text" class="inputLong required mobile" name="MainContacterMobile" id="MainContacterMobile" value="@Model.MainContacterMobile" />
                <span targetId="MainContacterMobile" class="tipMsg">请输入正确的移动电话</span>
            </li>
            <li class="clear"></li>
        </ul>
        <ul>
            <li class="formProp"><span>*</span>电子邮箱：</li>
            <li class="formLongLine">
                <input type="text" class="inputLong required email" name="MainContacterEmail" id="MainContacterEmail" value="@Model.MainContacterEmail" />
                <span targetId="MainContacterEmail" class="tipMsg">请输入正确的电子邮箱</span>
            </li>
            <li class="clear"></li>
        </ul>
        <ul>
            <li class="formProp"><span>*</span>姓名：</li>
            <li class="formLongLine">
                <input type="text" class="inputNormal required" name="Contacter" id="Contacter" value="@Model.Contacter" />
                <input type="radio" value="True" name="ContacterGender" @(Model.ContacterGender ? "checked" : "") /> 先生
                <input type="radio" value="False" name="ContacterGender" @(!Model.ContacterGender ? "checked" : "") /> 女士
                <span targetId="Contacter" class="tipMsg">请输入姓名</span>
            </li>
            <li class="clear"></li>
        </ul>
        <ul>
            <li class="formProp">职务：</li>
            <li class="formLongLine">
                <input type="text" class="inputLong" name="ContacterTitle" id="ContacterTitle" value="@Model.ContacterTitle" />
            </li>
            <li class="clear"></li>
        </ul>
        <ul>
            <li class="formProp"><span>*</span>移动电话：</li>
            <li class="formLongLine">
                <input type="text" class="inputLong required mobile" name="ContacterMobile" id="ContacterMobile" value="@Model.ContacterMobile" />
                <span targetId="ContacterMobile" class="tipMsg">请输入正确的移动电话</span>
            </li>
            <li class="clear"></li>
        </ul>
        <ul>
            <li class="formProp"><span>*</span>电子邮箱：</li>
            <li class="formLongLine">
                <input type="text" class="inputLong required email" name="ContacterEmail" id="ContacterEmail" value="@Model.ContacterEmail" />
                <span targetId="ContacterEmail" class="tipMsg">请输入正确的电子邮箱</span>
            </li>
            <li class="clear"></li>
        </ul>

        <div class="registerFormSubTitle">业务范围</div>
        <ul>
            <li class="formProp"><span>*</span>业务范围：</li>
            <li class="formLongLine">
                <ul class="multiSelections">
                @foreach (var scope in CacheHelper<code_scope>.GetAll().OrderBy(c => c.Order))
                {
                    <li @(scope.Title == "其他" ? "class=multiSelectionInput" : "")>
                        <input type="checkbox" @(scopes.Contains(scope.Id) ? "checked" : "") name="Scope" value="@scope.Id" /> @scope.Title
                        @if (scope.Title == "其他")
                        {
                        <input type="text" name="ScopeOtherName" class="inputNormal" value="@Model.ScopeOtherName" />
                        }
                    </li>
                }
                </ul>
            </li>
            <li class="clear"></li>
        </ul>
        
        <div class="registerFormSubTitle">关注展区</div>
        <ul>
            <li class="formProp"><span>*</span>关注展区：</li>
            <li class="formLongLine">
                <ul class="multiSelections">
                @foreach (var area in CacheHelper<code_area>.GetAll().OrderBy(c => c.Order))
                {
                    <li @(area.Title == "其他" ? "class=multiSelectionInput" : "")>
                        <input type="checkbox" @(areas.Contains(area.Id) ? "checked" : "") name="Area" value="@area.Id" /> @area.Title
                    </li>
                }
                </ul>
            </li>
            <li class="clear"></li>
        </ul>
        
        <div class="registerFormSubTitle">预计参会时间</div>
        <ul>
            <li class="formProp"><span>*</span>预计参会时间：</li>
            <li class="formLongLine">
                <input type="text" class="inputNormal required" name="StartDate" id="StartDate" value="@(Model.StartDate.HasValue ? Model.StartDate.Value.ToString("yyyy-MM-dd") : "")" />
                <span targetId="StartDate" class="tipMsg">必填</span>
                至
                <input type="text" class="inputNormal required" name="EndDate" id="EndDate" value="@(Model.EndDate.HasValue ? Model.StartDate.Value.ToString("yyyy-MM-dd") : "")" />
                <span targetId="EndDate" class="tipMsg">必填</span>
            </li>
            <li class="clear"></li>
        </ul>
        
        <div class="registerFormSubTitle">参会需求</div>
        <ul>
            <li class="formProp">寻求：</li>
            <li class="formLongLine">
                <ul class="multiSelections">
                @foreach (var purpose in CacheHelper<code_purpose>.GetAll().OrderBy(c => c.Order))
                {
                    <li @(purpose.Title == "其他" ? "class=multiSelectionInput" : "")>
                        <input type="checkbox" @(purposeNeeds.Contains(purpose.Id) ? "checked" : "") name="PurposeNeed" value="@purpose.Id" /> @purpose.Title
                    </li>
                }
                </ul>
            </li>
            <li class="clear"></li>
        </ul>
        <ul>
            <li class="formProp">提供：</li>
            <li class="formLongLine">
                <ul class="multiSelections">
                @foreach (var purpose in CacheHelper<code_purpose>.GetAll().OrderBy(c => c.Order))
                {
                    <li @(purpose.Title == "其他" ? "class=multiSelectionInput" : "")>
                        <input type="checkbox" @(purposeOffers.Contains(purpose.Id) ? "checked" : "") name="PurposeOffer" value="@purpose.Id" /> @purpose.Title
                    </li>
                }
                </ul>
            </li>
            <li class="clear"></li>
        </ul>
        <ul>
            <li class="formProp">信息标题：</li>
            <li class="formLongLine">
                <input type="text" class="inputLong" name="RequirementTitle" id="RequirementTitle" value="@Model.RequirementTitle" />
            </li>
            <li class="clear"></li>
        </ul>
        <ul>
            <li class="formProp">您的具体需求信息：</li>
            <li class="formLongLine">
                <textarea name="Requirement" id="Requirement" class="textareaLong" rows="6" cols="5">@Model.Requirement</textarea>
            </li>
            <li class="clear"></li>
        </ul>
        <ul>
            <li class="formProp">最少交易/投资金额：</li>
            <li class="formLongLine">
                <input type="text" class="inputNormal" name="Amount" id="Amount" value="@(Model.Amount > 0 ? Model.Amount.ToString() : "")" />
                （不填表示不设限额）
            </li>
            <li class="clear"></li>
        </ul>
        <ul>
            <li class="formProp">提供宣传单/宣传手册/产品样本？</li>
            <li class="formLongLine">
                <input type="radio" name="IsSampleProvided" @(Model.IsSampleProvided ? "checked" : "") value="True" /> 是
                <input type="radio" name="IsSampleProvided" @(!Model.IsSampleProvided ? "checked" : "") value="False"/> 否
                （如有签约项目，请向组委会索取《签约项目申报表》，申报项目）
            </li>
            <li class="clear"></li>
        </ul>
        <div class="registerFormSubTitle">展会服务</div>
        <ul>
            <li class="formProp"><span>*</span>展会服务：</li>
            <li class="formLongLine">
                <ul class="multiSelections">
                @foreach (var service in CacheHelper<code_service>.GetAll().OrderBy(c => c.Order))
                {
                    <li @(service.Title == "其他" ? "class=multiSelectionInput" : "")>
                        <input type="checkbox" @(services.Contains(service.Id) ? "checked" : "") name="Service" value="@service.Id" /> @service.Title
                        @if (service.Title == "其他")
                        {
                        <input type="text" name="ServiceOtherName" class="inputNormal" value="@Model.ServiceOtherName" />
                        }
                    </li>
                }
                </ul>
            </li>
            <li class="clear"></li>
        </ul>
        <div class="registerFormSubTitle">推荐媒体</div>
        <ul>
            <li class="formProp">网站：</li>
            <li class="formLongLine">
                <input type="text" class="inputLong" name="MediaWebSite" id="MediaWebSite" value="@Model.MediaWebSite" />
            </li>
            <li class="clear"></li>
        </ul>
        <ul>
            <li class="formProp">期刊：</li>
            <li class="formLongLine">
                <input type="text" class="inputLong" name="MediaPublication" id="MediaPublication" value="@Model.MediaPublication" />
            </li>
            <li class="clear"></li>
        </ul>
        <ul>
            <li class="formProp">杂志：</li>
            <li class="formLongLine">
                <input type="text" class="inputLong" name="MediaJournal" id="MediaJournal" value="@Model.MediaJournal" />
            </li>
            <li class="clear"></li>
        </ul>
        <ul>
            <li class="formProp">其他：</li>
            <li class="formLongLine">
                <input type="text" class="inputLong" name="MediaOther" id="MediaOther" value="@Model.MediaOther" />
            </li>
            <li class="clear"></li>
        </ul>


        <p class="selectTitle">是否愿意接收组委会定期服务邮件获得更多采购资讯？</p>
        <ul>
            <li class="formProp"></li>
            <li class="formLongLine">
                <input type="radio" name="IsReceiveEmail" @(Model.IsReceiveEmail ? "checked" : "") value="True" /> 是，Email
                <input type="text" class="inputNormal email mrl" name="ReceiveEmail" id="ReceiveEmail" value="@Model.ReceiveEmail" />
                <input type="radio" name="IsReceiveEmail" @(!Model.IsReceiveEmail ? "checked" : "") value="False"/> 否
            </li>
            <li class="clear"></li>
        </ul>
        @if (!isApproved)
        {
        <div class="clear"></div>
        <div class="solidLine"></div>
        <div class="buttonBox">
            <a class="smallButton" href="javascript:void()" onclick="$('#editForm').submit();">@(Model.Id == 0 ? "提交" : "保存")</a>
            <div style="display: none">
                <input id="submitbutton" type="submit" value="提  交" />
                <input type="button" value="取  消" />
            </div>
        </div>
        }
    </form>
    </div>
